function y = invtrans(para)
% INVTRANS(PARA)
%   transforms variables from model(restricted) 
%   to max(unrestricted)
%
% case 0, (-inf,inf) 
%   no adjustment needed
%   
% case 1, [a,b]
%   x/sqrt(1-x^2), x in [0,1]
%
% case 2, (a,inf)
%   ln(x), x in (0,inf)
%
% See also TRANS, PARA_SPEC.TXT

% June 9, 2004
% Sungbae An
global paraspec_;

y = para;

for i=1:length(para)
    a = paraspec_(i,2);
    b = paraspec_(i,3);
    c = paraspec_(i,4);

    if paraspec_(i,1)==1;
		cx = 2*(para(i)-(a+b)/2)/(b-a);
		y(i) = (1/c)*cx/sqrt(1-cx^2);

    elseif paraspec_(i,1)==2;
		y(i) = b + (1/c)*log(para(i)-a);

	end
end
